(function($){  
 $.fn.barcoder = function(options) {  
  
  var defaults = {
	size: "large",
	height: "normal",
	vertical: false
  };  
  var options = $.extend(defaults, options);  
      
  return this.each(function() {  

	obj = $(this);
	obj.addClass("bathbi-barcode")
	if(isNaN(options.size)) { obj.addClass("bathbi-" + options.size);}
	else { obj.css("zoom", options.size + "%");}

	if (options.vertical) { obj.addClass("bathbi-viewvertical");}

	str = obj.text();
	newstr = "<span class=\"bathbi-barcodec\"></span>";
	for (var i = 0, len = str.length; i < len; i++) {newstr += "<span class=\"bathbi-barcode" + str[i] + "\"></span>"}
	newstr += "<span class=\"bathbi-barcodec\"></span>";
	obj.html(newstr);

	if(isNaN(options.height)) {
		obj.addClass("bathbi-" + options.height + "height");
	} else {
		obj.css("height", options.height + "px");
		obj.children('span').css("height", options.height + "px");
	}

  });  
 };  
})(jQuery);